package com.daocao.jy.activity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.daocao.jy.Application;
import com.daocao.jy.R;
import com.daocao.jy.base.BaseActivity;
import com.daocao.jy.util.Dialog;
import com.daocao.jy.util.PreferenceUtils;
import com.daocao.jy.util.Util;
import com.daocao.jy.view.V19FrameLayout;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by xsooy-pc on 17-12-8.
 */

public class ChatCenterActivity extends BaseActivity {
    @BindView(R.id.btn_back)
    ImageView btnBack;
    @BindView(R.id.txt_title)
    TextView txtTitle;
    @BindView(R.id.txt_right)
    TextView txtRight;
    @BindView(R.id.layout_title)
    V19FrameLayout layoutTitle;

    private Unbinder unbiner;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_chat_center);
        initBar();
        unbiner = ButterKnife.bind(this);
        init();
    }

    private void init() {
        txtTitle.setText("客服中心");
        txtRight.setVisibility(View.VISIBLE);
        txtRight.setText("意见反馈");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        unbiner.unbind();
        unbiner = null;
    }

    @OnClick({R.id.btn_back, R.id.txt_right, R.id.img_second_code, R.id.btn_call})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.btn_back:
                finish();
                break;
            case R.id.txt_right:
                Util.startActivity(this, MySuggestActivity.class);
                break;
            case R.id.img_second_code:
                break;
            case R.id.btn_call:
                Dialog.showDefaultDialog(this, "提示", "请确认拨打智信派官方电话", "拨打", "取消",false,new Dialog.DialogDefaultClickListener() {
                    @Override
                    public void confirm() {
                        Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + PreferenceUtils.getString(Application.getInstance(), "service_phone", "")));
                        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        startActivity(intent);
                    }

                    @Override
                    public void cancel() {

                    }
                });
                break;
        }
    }
}
